/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package universityModel.curriculum;

import universityModel.lesson.LessonInterface;
import universityModel.utils.ArrayModel;
import universityModel.utils.OutputControl;

/**
 *
 * @author Admin
 */
/**
 * Describe a one day with pairs
 */
public class Day extends OutputControl { 
    private final int NUM_PAIRS = 4;
    private WeekDays weekday; 
    private ArrayModel<LessonInterface> lessons = new ArrayModel<LessonInterface>();
        
    public Day(WeekDays weekday) {
	this.weekday = weekday;
    }
	 
    public void add(LessonInterface lesson) { 
	lessons.add(lesson);
    }
	
    public String getDay() {
        StringBuilder sb = new StringBuilder();
        sb.append("Day: ");
        sb.append(weekday);
        sb.append("\n");
        
        for(int numOfPair = 0; numOfPair < lessons.size(); numOfPair++) {
            sb.append(lessons.get(numOfPair).toString());
            sb.append("\n");
        }
        
        return sb.toString();
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
	}
		
        if (obj == null) {
		return false;
	}
        
	if (getClass() != obj.getClass()) {
		return false;
	}
        
        Day d = (Day)obj;
        return getDay().equals(d.getDay());
    }
}
